package com.lrs.java.j2se_self.exception;

public class TestException {
	public void output(int[] i){
		int j = i.length;
		for(int k=0;k<j;k++){
			try{
				System.out.println(i[k]);
			}catch(ArrayIndexOutOfBoundsException e){
				e.getMessage();
			}
		}
	}
	
	public static void main(String[] args){
		TestException ex = new TestException();
		int[] a=new int[5];
		for(int i=0;i<a.length;i++){
			a[i]=i;
		}
		ex.output(a);
	}
}
